Skip to content

Print a more sensible error when the user's edge preview token is expired#6472

Closed
kflansburg wants to merge 2 commits intocloudflare:mainfrom
kflansburg:kflansburg/fix-1031
Closed

Print a more sensible error when the user's edge preview token is expired#6472
kflansburg wants to merge 2 commits intocloudflare:mainfrom
kflansburg:kflansburg/fix-1031

Conversation

@kflansburg
Copy link
Copy Markdown
Member

No description provided.

Copy link
Copy Markdown
Member

@JoaquinGimenez1 JoaquinGimenez1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kflansburg kflansburg force-pushed the kflansburg/fix-1031 branch from 7a1c20a to fcbcb27 Compare April 1, 2026 00:17
@kflansburg kflansburg marked this pull request as ready for review April 1, 2026 00:26
@kflansburg kflansburg requested review from a team as code owners April 1, 2026 00:26
@kflansburg kflansburg changed the title Print a more sensible error when the user's token is expired Print a more sensible error when the user's edge preview token is expired Apr 1, 2026
@kflansburg kflansburg force-pushed the kflansburg/fix-1031 branch from fcbcb27 to c4a81bf Compare April 1, 2026 00:28
Copy link
Copy Markdown
Member

@kentonv kentonv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is the same issue as: cloudflare/workers-sdk#12901

If fixed in wrangler, then the error message here should become irrelevant?

@penalosa did some work to fix it there though it seems like it's still broken for me unfortunately.

// preview token has expired (e.g. during `wrangler dev`).
if (content.includes('error code: 1031')) {
return new InferenceUpstreamError(
`${content} (your API token may have expired — try running \`wrangler login\` to obtain a fresh token and restart your dev server)`
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think running wrangler login again is required. Simply restarting wrangler solves the problem.

@kflansburg
Copy link
Copy Markdown
Member Author

I think this is the same issue as: cloudflare/workers-sdk#12901

If fixed in wrangler, then the error message here should become irrelevant?

@penalosa did some work to fix it there though it seems like it's still broken for me unfortunately.

Yes, thank you. @thatsKevinJain is looking in to resolving the issue in cloudflare/workers-sdk#12901

@kflansburg kflansburg closed this Apr 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants